package com.dandelion.api.dao;

import com.dandelion.common.domain.UserAddressVO;
import com.rockit.core.pojo.Pagination;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

@Mapper
public interface UserAddressDao {
    @SelectProvider(type = UserAddressDaoSqlProvider.class, method = "getUserAddressListSql")
    List<UserAddressVO> query(@Param("userId") long userId, Pagination pagination);

    @Delete("update t_user_address t0 set t0.is_deleted=1 where t0.id=#{addrId} and t0.user_id=#{userId}")
    void delete(@Param("userId") long userId, @Param("addrId") long addrId);
}
